#!/bin/sh

#-----------------------------------------------------------------------
# Force CWPROOT to be parent
#-----------------------------------------------------------------------

J=`/bin/pwd | sed 's:/src::' `

export CWPROOT

CWPROOT=${J}

echo "CWPROOT set to ${CWPROOT}"

#-----------------------------------------------------------------------
# cleanup any old files
#-----------------------------------------------------------------------

if [ -d ../bin ]
   then
   ( cd ../; mkdir jnk; mv bin lib include make.log jnk; rm -rf jnk &)
fi

./Clean

#-----------------------------------------------------------------------
# compile it all (almost)
#-----------------------------------------------------------------------

touch LICENSE_43_ACCEPTED

echo "Making install" | tee ../make.log
( make install 2>&1 | tee -a ../make.log )   << EOF 
y
n
EOF

echo "Making xtinstall" | tee -a ../make.log
( make xtinstall  2>&1 | tee -a ../make.log )   << EOF
y
n
EOF

echo "Making finstall" | tee -a ../make.log
( make finstall   2>&1 | tee -a ../make.log )   << EOF
y
n
EOF

#echo "Making mglinstall" | tee -a ../make.log
#( make mglinstall 2>&1 | tee -a ../make.log )   << EOF
#y
#n
#EOF

echo "Making utils" | tee -a ../make.log
( make utils      2>&1 | tee -a ../make.log )   << EOF
y
n
EOF

echo "Making xminstall" | tee -a ../make.log
( make xminstall  2>&1 | tee -a ../make.log )   << EOF
y
n
EOF

exit

echo "Making sfinstall" | tee -a ../make.log
( make sfinstall  2>&1 | tee -a ../make.log )   << EOF
y
n
EOF

